package com.eastfair.builder.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.builder.dto.ExhibitorDTO;
import com.eastfair.builder.entity.Exhibitor;
import com.eastfair.builder.vo.ExhibitorVO;
import com.eastfair.home.vo.BuilderRepairReportVO;
import com.eastfair.venueservice.dto.ServiceProviderSpaceQuery;
import com.eastfair.venueservice.vo.BondManageVO;
import com.eastfair.venueservice.vo.ServiceOrderVO;
import com.eastfair.venueservice.vo.WorkOvertimeVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 业务接口
 * 展商
 * </p>
 *
 * @author dq
 * @date 2022-08-06
 */
public interface ExhibitorService extends SuperService<Exhibitor> {

    /**
     * 分页查询展商列表VO.
     *
     * @param pageParams the page params
     * @return the page
     */
    Page<ExhibitorVO> listExhibitorVOs(PageParams<ExhibitorDTO> pageParams);

    /**
     * 分页查询未报馆的展位列表.
     *
     * @param pageParams the page params
     * @return the page
     */
    Page<ExhibitorVO> listNotReportSpaceExhibitorVOs(PageParams<ExhibitorDTO> pageParams);

    /**
     * 展商邀请码调用展商系统接口获取展商列表.
     *
     * @param inviteCode   the invite code
     * @param exhibitionId the exhibition id
     * @return the list
     */
    List<ExhibitorVO> listByInviteCode(String inviteCode, Long exhibitionId);

    /**
     * 展商邀请码查询展商列表
     *
     * @param inviteCode the invite code
     * @return the list
     */
    List<Exhibitor> listByInviteCode(String inviteCode);

    /**
     * 分页查询展商列表.
     *
     * @param pageParams the page params
     * @return the page
     */
    Page<Exhibitor> listExhibitors(PageParams<ExhibitorDTO> pageParams);

    /**
     * 查询展商列表VO.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the list
     */
    List<ExhibitorVO> listExhibitorVOs(ExhibitorDTO exhibitorDTO);

    /**
     * 查询展商列表.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the list
     */
    List<Exhibitor> listExhibitors(ExhibitorDTO exhibitorDTO);

    /**
     * 通过展会，主场，展厅查询展位.
     *
     * @param query the query
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.eastfair.builder.vo.ExhibitorVO>  page
     * @Author clm
     * @Description //通过展会，主场，展厅查询展位
     * @Date 17 :12 2022/11/15
     * @Param [query]
     */
    Page<ExhibitorVO> queryServiceProviderSite(PageParams<ExhibitorDTO> query) throws Exception;

    /**
     * 通过展会查询展位
     *
     * @param query the query
     * @return list
     */
    List<ExhibitorVO> queryAllServiceProviderSite(ServiceProviderSpaceQuery query);

    /**
     * 获取展商详情.
     *
     * @param id the id
     * @return the exhibitor
     */
    ExhibitorVO getExhibitorVO(Long id);

    /**
     * 保存展商.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    boolean saveExhibitor(ExhibitorDTO exhibitorDTO);

    /**
     * 批量保存展商
     *
     * @param list the list
     * @return the boolean
     */
    boolean saveBatch(List<ExhibitorDTO> list);

    /**
     * 修改展商.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    boolean updateExhibitor(ExhibitorDTO exhibitorDTO);

    /**
     * 更新展位单双层，是否吊点.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    boolean updateIsDoubleAndIsPoint(ExhibitorDTO exhibitorDTO);

    /**
     * 更新展位状态.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    boolean updateSiteStatus(ExhibitorDTO exhibitorDTO);

    /**
     * 更新展位状态为报馆中.
     *
     * @param id the exhibitor id
     * @return the boolean
     */
    boolean updateSiteStatusReporting(Long id);

    /**
     * 更新展位状态为已报馆.
     *
     * @param id the id
     * @return the boolean
     */
    boolean updateSiteStatusHasReported(Long id);

    /**
     * 更新展位重置.
     *
     * @param id the id
     * @return the boolean
     */
    boolean updateIsReset(Long id);

    /**
     * 更新展商应付金额.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    boolean updateShouldEarnestMoney(ExhibitorDTO exhibitorDTO);

    /**
     * 更新应支付保证金.
     *
     * @param exhibitorId        the exhibitor id
     * @param shouldEarnestMoney the should earnest money
     * @return the boolean
     */
    boolean updateShouldEarnestMoney(Long exhibitorId, BigDecimal shouldEarnestMoney);

    /**
     * 更新保证金支付状态.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    boolean updateEarnestMoneyPayStatus(ExhibitorDTO exhibitorDTO);

    /**
     * 更新保证金余额.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    @Deprecated
    boolean updateRemainEarnestMoney(ExhibitorDTO exhibitorDTO);

    /**
     * 扣除保证金.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    @Deprecated
    boolean deductEarnestMoney(ExhibitorDTO exhibitorDTO);

    /**
     * 退还保证金.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the boolean
     */
    @Deprecated
    boolean refundEarnestMoney(ExhibitorDTO exhibitorDTO);

    /**
     * 批量移除展商.
     *
     * @param ids the ids
     * @return the boolean
     */
    boolean removeByIds(List<Long> ids);

    /**
     * 检查搭建商在该展会的展位唯一性.
     *
     * @param exhibitionId        the exhibition id
     * @param builderId           the builder id
     * @param externalExhibitorId the external exhibitor id
     * @param spaceCode           the space code
     * @param siteCode            the site code
     * @return the boolean
     */
    boolean checkSiteUnique(Long exhibitionId, Long builderId, String externalExhibitorId, String spaceCode, String siteCode);

    /**
     * 检查展商，展厅，展位的唯一性.
     *
     * @param externalExhibitorId the external exhibitor id
     * @param spaceCode           the space code
     * @param siteCode            the site code
     * @return the boolean
     */
    boolean checkSiteUnique(String externalExhibitorId, String spaceCode, String siteCode);

    /**
     * 校验展商邀请码是否唯一
     *
     * @param inviteCode the invite code
     * @return the boolean
     */
    boolean checkInviteCodeExist(String inviteCode);

    /**
     * 通过服务订单校验展位是否可重置
     *
     * @param serviceOrderList the service order list
     * @return the boolean
     */
    List<String> checkOrderForExhibitorReset(List<ServiceOrderVO> serviceOrderList);

    /**
     * 通过保证金订单校验展位是否可重置
     *
     * @param bondManageList the bond manage list
     * @return the boolean
     */
    List<String> checkBondForExhibitorReset(List<BondManageVO> bondManageList);

    /**
     * 通过搭建商报修单校验展位是否可重置
     *
     * @param builderRepairReportList the builder repair report list
     * @return the list
     */
    List<String> checkBuilderRepairReportForExhibitorReset(List<BuilderRepairReportVO> builderRepairReportList);

    /**
     * 通过加班单校验展位是否可重置
     *
     * @param workOvertimeList the list
     * @return the list
     */
    List<String> checkWorkOvertimeForExhibitorReset(List<WorkOvertimeVO> workOvertimeList);

    /**
     * 校验是否可重置
     *
     * @param exhibitor the exhibitor
     * @return the boolean
     */
    boolean checkForExhibitorReset(Exhibitor exhibitor);
}
